/*
 * 作者：姚俊
 * 功能：发送留言的action
 * 日期：2015-07-05
 */
package admin.action.note;

import teacher.bean.Teacher;

import admin.bean.Note;
import admin.service.fruits.NoteService;

import com.opensymphony.xwork2.ActionContext;

public class SendNoteAction {
	
	private String content;
	private int toUser;
	private String title;
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public int getToUser() {
		return toUser;
	}
	public void setToUser(int toUser) {
		this.toUser = toUser;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	
	
	public String execute()
	{
		
		Teacher tea=(Teacher)ActionContext.getContext().getSession().get("admin");
		Note note=new Note();
		note.setContent(this.getContent());
		note.setTitle(this.getTitle());
		note.setToUser(this.getToUser());
		note.setFromUser(tea.getTeaId());
		note.setState(0);
		System.out.println("现在我要开始发送我的留言了");
		new NoteService().insertNote(note);
		return null;
	}

}
